<template>
    <pageTabelLayout>
        <template #pageHeader>
            <div class="search-form divClass" v-if="headerShow">
                <div>
                    <a-form :model="dateForm" layout="inline" size="small">
                        <a-form-item label="记录单号" :style="{ width: '270px' }" label-col-flex="70px">
                            <a-input class="bacClass" disabled v-model="dateForm.recordCode" allow-clear></a-input>
                        </a-form-item>
                        <a-form-item label="当班日期" :style="{ width: '270px' }" label-col-flex="70px">
                            <a-date-picker  popup-container="html"  class="bacClass" v-model="dateForm.beginDate" allow-clear />
                        </a-form-item>
                        <a-form-item label="至" :style="{ width: '270px' }" label-col-flex="70px">
                            <a-date-picker  popup-container="html"  class="bacClass" v-model="dateForm.endDate" allow-clear />
                        </a-form-item>
                        <!-- <a-form-item label="部门名称">
                            <a-input class="bacClass" v-model="dateForm.department" allow-clear
                                ></a-input>
                        </a-form-item> -->
                        <CorporateSectorCascader :configCascader="configCascader"
                            @changeCascader="changeCascader" />
                        <a-form-item label="班次" :style="{ width: '270px' }" label-col-flex="70px">
                            <a-select popup-container="html"  class="bacClass" :allowClear="true" v-model="dateForm.workteam" :filter-option="false"
                                allow-search>
                                <a-option>A班</a-option>
                                <a-option>B班</a-option>
                            </a-select>
                        </a-form-item>
                        <a-form-item label="设备编号" :style="{ width: '270px' }" label-col-flex="70px">
                            <a-input class="bacClass" disabled v-model="dateForm.machineCode" allow-clear></a-input>
                        </a-form-item>
                        <a-form-item label="员工工号" :style="{ width: '270px' }" label-col-flex="70px">
                            <a-input class="bacClass" v-model="dateForm.userCode" allow-clear></a-input>
                        </a-form-item>
                        <a-form-item label="员工姓名" :style="{ width: '270px' }" label-col-flex="70px">
                            <a-input class="bacClass" disabled v-model="dateForm.userName" allow-clear></a-input>
                        </a-form-item>
                    </a-form>
                </div>

            </div>
            <div class="search-form divClass" v-if="headerShow" style="float: right;">
                <Toolbar :items="toolbarList" @add="addHandler" @select="selectHandler" @del="deleteHandler"
                    @export="EXELTABLE(tc, pageData.dataListOP, '染色直通奖列表')">
                </Toolbar>
            </div>
            <div class="my-divisders">
                <a-divider orientation="center">
                    <icon-double-up v-if="headerShow" @click="headerShow = false" :strokeWidth="2" :size="18" />
                    <icon-double-down v-else @click="headerShow = true" :strokeWidth="2" :size="18" />
                </a-divider>
            </div>
        </template>
        <template #pageTabel>
            <!-- <a-tabs   :justify="true" :default-active-key="tabsKeys" @change="tabsChanges">
                <a-tab-pane> -->
            <AgGridVuesCopys :rowHeight="33" :headerHeight="33" :suppressCopyRowsToClipboard="true" rowSelection="multiple" @grid-ready="gridReady"
            style="height: calc(100% - 45px);" :defaultColDef="defaultColDef" class='ag-theme-alpine' :rowData="pageData.dataListOP"
                :columnDefs="tc" :localeText="localeText1">
            </AgGridVuesCopys>
            <paginationCopys :page-size-options="pagingList1" :total="total" show-total show-jumper show-page-size
                @change="PageSize" @page-size-change="change" style="justify-content: center"
                :page-size="pagination.pageSize" :current="pagination.page" />
            <!-- </a-tab-pane>
            </a-tabs> -->
        </template>
        <a-drawer :drawer-style="{ 'zIndex': 9999 }" :mask-closable="false" height="90%" :visible="pageData.showAdd8"
            unmountOnClose @ok="sideOk" @cancel="pageData.showAdd8 = false" :width="400" cancel-text='关闭' ok-text='保存'
            placement="bottom">
            <template #title>
                {{ pageData.sideTitle }}
            </template>
            <a-form :model="objectOP" layout="inline" size="small">
                <a-form-item label="记录单号">
                    <a-input class="bacClass" disabled v-model="objectOP.recordCode" allow-clear></a-input>
                </a-form-item>
                <a-form-item label="当班日期">
                    <a-date-picker  popup-container="html"  class="bacClass" v-model="objectOP.workDate" allow-clear style="width:200px" />
                </a-form-item>
                <!-- <a-form-item label="部门名称">
                    <a-input class="bacClass" v-model="objectOP.department" allow-clear ></a-input>
                </a-form-item> -->
                <CorporateSectorCascader :style="{ width: '200px' }" :configCascader="configCascader"
                    @changeCascader="changeCascader1" />
                <a-form-item label="班次">
                    <a-select popup-container="html"  style="width: 200px;" class="bacClass" :allowClear="true" v-model="objectOP.workteam"
                        :filter-option="false" allow-search>
                        <a-option>A班</a-option>
                        <a-option>B班</a-option>
                    </a-select>
                </a-form-item>
                <a-form-item label="设备编号">
                    <a-input class="bacClass" v-model="objectOP.machineCode" allow-clear></a-input>
                </a-form-item>
            </a-form>
            <!-- <div style="color:#165dff;" class="gesture">直通奖员工<span></span></div> -->
            <el-button style="color:#ee3f4d;font-size: 16px;margin: 5px 0px 15px 15px;" class="gesture"
                link>直通奖员工</el-button>
            <AgGridVuesCopys :rowHeight="33" :headerHeight="33" :suppressCopyRowsToClipboard="true" rowSelection="multiple" @grid-ready="gridReady1"
                style="height:40%;width: 55%;" :defaultColDef1="defaultColDef1" class='ag-theme-alpine'
                :rowData="tableDataList1" :columnDefs="dc" :localeText="localeText1"></AgGridVuesCopys>

            <!-- <div style="color:#165dff;" class="gesture">配方扫描产量<span></span></div> -->
            <el-button style="color:#ee3f4d;font-size: 16px;margin: 15px 0px 15px 15px;" class="gesture"
                link>配方扫描产量</el-button>
            <div style="float: right;"><el-button style="color:#165dff;" class="gesture" link
                    @click="select">选择</el-button><el-button style="color:#165dff;" class="gesture" link
                    @click="dels">删除</el-button>
            </div>
            <AgGridVuesCopys :rowHeight="33" :headerHeight="33" :suppressCopyRowsToClipboard="true" rowSelection="multiple" @grid-ready="gridReady1_2"
                style="height:50%" :defaultColDef1_2="defaultColDef1_2" class='ag-theme-alpine' :rowData="tableDataList1_2"
                :columnDefs="dc2" :localeText="localeText1"></AgGridVuesCopys>

        </a-drawer>
        <a-modal v-model:visible="visiblecg" ok-text="确定" @ok="print" :width="1200">
            <div class="contioner" style="height: 100%;">
                <div :style="{ height: '400px', padding: '10px' }">
                    <AgGridVuesCopys :rowHeight="33" :headerHeight="33" :suppressCopyRowsToClipboard="true" v-loading="loadingElplus" rowSelection="multiple"
                        @grid-ready="gridReady5" style="height: 90%" :defaultColDef="defaultColDef" class="ag-theme-alpine"
                        :rowData="pageData.dataList" :columnDefs="dc4" :localeText="localeText1"></AgGridVuesCopys>
                    <paginationCopys :total="pageData.total" show-total show-jumper show-page-size @change="PageSize"
                        @page-size-change="change" style="justify-content: center" :page-size="pagination.pageSize"
                        :current="pagination.page" :page-size-options="pagingList1" />
                </div>
            </div>
        </a-modal>
    </pageTabelLayout>
</template>
<script setup lang="ts">
import {
    useTable,
    useRowKey,
    useTableColumn,
    usePagination,
    useRowSelection,
} from "@/hooks/table";
import { ref, reactive } from "vue"
import { post, get } from "@/api/http"
import { localeText } from '@/api/aggridZw'

import Toolbar from "@/components/Toolbar.vue"
import { Message, Modal } from "@arco-design/web-vue"
import CorporateSectorCascader from '@/components/corporateSectorCascader/inde.vue'
import { FormInstance } from "@arco-design/web-vue/es/form";
import { pagingList } from "@/api/paging";
import { EXPORTEXEL, EXELTABLE } from '@/utils/exportEXCEL'
import axios from "axios";
const toolbarList: any = ref(['查询', '新增', '删除', '导出'])
let configCascader = ref<{}>({
    corporateWidth: '190px', //公司宽度
    sectorWidth: '190px', //部门宽度
    corporateRquired: false, //公司是否必填
    sectorRquired: false, //部门是否必填
    size: 'small', //选择框大小'mini' | 'small' | 'medium' | 'large'
    corporateName: '选择部门', //公司label
    sectorName: '选择部门', //部门label
    cascaderShow: 'sector', //配置部门不显示
})
const changeCascader = (data: any) => {
    // const { corporateId } = data
    // whList.value = []
    // searchData.wh = ''
    // searchData.firm = corporateId
    // whService.getWarhouseList(corporateId, '原纱仓')
    dateForm.department = data.corporateLabel
}
const changeCascader1 = (data: any) => {
    objectOP.department = data.corporateLabel
}
function PageSize(val: any) {
    pagination.page = val
    doRefresh();
}

function change(val: any) {
    pagination.pageSize = val
    doRefresh();
}
const headerShow = ref(true)
const tableDataList = ref([])
const tableDataList1: any = ref([])
const tableDataList1_2: any = ref([])

const gridOption = ref()
const gridReady = (params: any) => {
    gridOption.value = params.api
}
const gridOption1 = ref()
const gridReady1 = (params: any) => {
    gridOption1.value = params.api
}
const gridOption1_2 = ref()
const gridReady1_2 = (params: any) => {
    gridOption1_2.value = params.api
}
const gridOption5 = ref()
const gridReady5 = (params: any) => {
    gridOption5.value = params.api
}
const defaultColDef = {
    sortable: true,
    resizable: true,
    filter: true,
}
const defaultColDef1 = {
    sortable: true,
    resizable: true,
    filter: true,
}
const defaultColDef1_2 = {
    sortable: true,
    resizable: true,
    filter: true,
}
const localeText1: any = ref(localeText)
const tc = [
    {
        showRowGroup: 'hide_def',
        "headerName": "",
        "checkboxSelection": true,
        "headerCheckboxSelection": true,
        "pinned": "left",
        "width": 50,
        resizable: false,
        filter: false,
        sortable: false,
        minWidth: 50,
        maxWidth: 50,
        lockPosition: "left",
    },
    {
        headerName: '记录单号',
        field: 'recordCode',
        width: 150,
        filter: 'recordCode',
    },
    {
        headerName: '开单日期',
        field: 'billDate',
        width: 150
    },
    {
        headerName: '部门名称',
        field: 'department',
        width: 150
    },
    {
        headerName: '班次',
        field: 'workteam',
        width: 150
    },
    {
        headerName: '设备编号',
        field: 'machineCode',
        width: 150
    },
    {
        headerName: '员工工号',
        field: 'userCode',
        width: 150
    },
    {
        headerName: '员工姓名',
        field: 'userName',
        width: 150
    },
    {
        headerName: '金额',
        field: 'money',
        width: 150
    },
    {
        headerName: "创建人",
        field: "createName",
        width: 150
    },
    {
        headerName: "创建时间",
        field: "createTime",
        width: 150
    },
    {
        headerName: "最后修改人",
        field: "updateName",
        width: 150
    },
    {
        headerName: "最后修改时间",
        field: "updateTime",
        width: 150
    },
    {
        headerName: '操作',
        field: 'id',
        pinned: 'right',
        width: 150,
        cellRenderer: {
            template: `
            <el-button style="color:#165dff;" @click="a" class="gesture" link>修改</el-button>
            `,
            setup(props: any) {
                const a = () => {
                    editHandler(props.params.data)
                }
                return {
                    a
                }
            }
        }
    }
]
const dc = [
    {
        showRowGroup: 'hide_def',
        "headerName": "",
        "checkboxSelection": true,
        "headerCheckboxSelection": true,
        "pinned": "left",
        "width": 50,
        resizable: false,
        filter: false,
        sortable: false,
        minWidth: 50,
        maxWidth: 50,
        lockPosition: "left",
    },
    {
        headerName: '员工工号',
        field: 'userCode',
        width: 250,
        filter: 'userCode',
    },
    {
        headerName: '员工姓名',
        field: 'userName',
        width: 250
    },
    {
        headerName: '金额',
        field: 'money',
        width: 450
    },

]
const dc2 = [
    {
        showRowGroup: 'hide_def',
        "headerName": "",
        "checkboxSelection": true,
        "headerCheckboxSelection": true,
        "pinned": "left",
        "width": 50,
        resizable: false,
        filter: false,
        sortable: false,
        minWidth: 50,
        maxWidth: 50,
        lockPosition: "left",
    },
    {
        headerName: '部门',
        field: 'department',
        width: 150,
        filter: 'department',
    },
    {
        headerName: '当班日期',
        field: 'workDate',
        width: 150
    },
    // {
    //     headerName: '班次',
    //     field: 'shift',
    //     width: 150
    // },
    {
        headerName: '班次',
        field: 'workteam',
        width: 150
    },
    {
        headerName: '流转卡号',
        field: 'circulatCard',
        width: 150
    },
    {
        headerName: '染色日期',
        field: 'dyeDate',
        width: 150
    },
    {
        headerName: '作业类型',
        field: 'jobType',
        width: 150
    },
    {
        headerName: '设备编号',
        field: 'machineCode',
        width: 150
    },

    {
        headerName: '客户名称',
        field: 'customName',
        width: 150,
    },
    {
        headerName: '布号',
        field: 'clothCode',
        width: 150
    },
    {
        headerName: '品名',
        field: 'brandName',
        width: 150
    },
    {
        headerName: '色号',
        field: 'colorCode',
        width: 150
    },
    {
        headerName: '色称',
        field: 'colorName',
        width: 150
    },
    {
        headerName: '颜色深浅',
        field: 'colorDepth',
        width: 150
    },
    {
        headerName: '匹数',
        field: 'horseNum',
        width: 150
    },
    {
        headerName: '重量',
        field: 'weight',
        width: 150
    },
    {
        headerName: '员工工号',
        field: 'userCode',
        width: 150,
    },
    {
        headerName: '员工姓名',
        field: 'userName',
        width: 150
    },
    {
        headerName: '直通',
        field: 'directState',
        width: 150,
        cellRenderer: {
            template: `
            <el-checkbox v-model="val" :true-label="1" :false-label="0" disabled></el-checkbox>
            `,
            setup(props: any) {
                let val = ref()
                val.value = props.params.data.pieceCloth
                return {
                    val
                }
            }
        }
    },
    {
        headerName: '设备容量',
        field: 'machineCapacity',
        width: 150
    },
    {
        headerName: '管数',
        field: 'tubeNum',
        width: 150
    },
    {
        headerName: '金额',
        field: 'money',
        width: 150
    },
    {
        headerName: '车间',
        field: 'workshop',
        width: 150
    },
    {
        headerName: '拼缸缸号',
        field: 'putCylinderNo',
        width: 150
    },
]
const dc4 = [
    {
        showRowGroup: 'hide_def',
        "headerName": "",
        "checkboxSelection": true,
        "headerCheckboxSelection": true,
        "pinned": "left",
        "width": 50,
        resizable: false,
        filter: false,
        sortable: false,
        minWidth: 50,
        maxWidth: 50,
        lockPosition: "left",
    },
    // {
    //     headerName: '班次',
    //     field: 'shift',
    //     width: 150,
    //     filter: 'shift',
    // },
    {
        headerName: '班次',
        field: 'workteam',
        width: 150
    },
    {
        headerName: '流转卡号',
        field: 'circulatCard',
        width: 150
    },
    {
        headerName: '染色日期',
        field: 'dyeDate',
        width: 150
    },
    {
        headerName: '作业类型',
        field: 'jobType',
        width: 150
    },
    {
        headerName: '设备编号',
        field: 'machineCode',
        width: 150
    },

    {
        headerName: '客户名称',
        field: 'customName',
        width: 150,
    },
    {
        headerName: '布号',
        field: 'clothCode',
        width: 150
    },
    {
        headerName: '品名',
        field: 'brandName',
        width: 150
    },
    {
        headerName: '色号',
        field: 'colorCode',
        width: 150
    },
    {
        headerName: '色称',
        field: 'colorName',
        width: 150
    },
    {
        headerName: '颜色深浅',
        field: 'colorDepth',
        width: 150
    },
    {
        headerName: '匹数',
        field: 'horseNum',
        width: 150
    },
    {
        headerName: '重量',
        field: 'weight',
        width: 150
    },
    {
        headerName: '员工工号',
        field: 'userCode',
        width: 150,
    },
    {
        headerName: '员工姓名',
        field: 'userName',
        width: 150
    },
    {
        headerName: '设备容量',
        field: 'machineCapacity',
        width: 150
    },
    {
        headerName: '管数',
        field: 'tubeNum',
        width: 150
    },
    {
        headerName: '金额',
        field: 'money',
        width: 150
    },
    {
        headerName: '车间',
        field: 'workshop',
        width: 150
    },
    {
        headerName: '拼缸缸号',
        field: 'putCylinderNo',
        width: 150
    },
]
const objectOP = reactive<{
    recordCode: any
    workDate: any
    department: any
    workteam: any
    pieceCloth: any
    machineCode: any
    //子表一key名
    DyeDirectMoneyUser: any[]
    //子表二key名
    DyeDirectMoneyDetail: any[],
}>({
    recordCode: '',
    workDate: '',
    department: '',
    workteam: '',
    pieceCloth: '',
    machineCode: '',
    DyeDirectMoneyUser: [],
    DyeDirectMoneyDetail: [],
});
const dateForm = reactive<{
    id: any;
    recordCode: any,
    beginDate: any,
    endDate: any,
    department: any,
    workteam: any,
    machineCode: any,
    userCode: any,
    userName: any,
    page: any;
    size: any;
    deleteState: any
}>({
    id: null,
    recordCode: '',
    beginDate: '',
    endDate: '',
    department: '',
    workteam: '',
    machineCode: '',
    userCode: '',
    userName: '',
    page: null,
    size: null,
    deleteState: 0
})
const pageData = reactive<{
    sideTitle: string,
    showAdd8: boolean,
    pageLoading: boolean,
    total: any
    dataList: any[],
    nameList: any[],
    nameList1: any[],
    dataListOP: any[],
    notInIdList: any[],
}>({
    sideTitle: "新增染色直通奖",
    showAdd8: false,
    pageLoading: false,
    total: 0,
    dataList: [],
    nameList: [],
    nameList1: [],
    dataListOP: [],
    notInIdList: [],
});

const editHandler = (record: any) => {
    for (let key in record) {
        objectOP[key] = record[key]
    }
    pageData.sideTitle = '修改染色直通奖';
    pageData.showAdd8 = true;

}
const addHandler = () => {
    for (var key in objectOP) {
        if (key == "id") {
            objectOP[key] = null;

        } else {
            objectOP[key] = '';
        }
    }
    pageData.sideTitle = "新增染色直通奖";
    pageData.showAdd8 = true;
    tableDataList1.value = []
    tableDataList1_2.value = []
    post({
        url: "/dwPc/DyeDirectMoney/getCodeGenerate",
        data: {}
    }).then(({ code, data, message }: any) => {
        if (code === 200) {
            objectOP.recordCode = data
        }
    });
}
const selectHandler = () => {
    doRefresh()
}


// 新增事件
const formRef = ref<FormInstance>();
const sideOk = () => {
    objectOP.DyeDirectMoneyUser = tableDataList1.value
    objectOP.DyeDirectMoneyDetail = tableDataList1_2.value
    // formRef.value?.validate().then((err) => {
    //     if (!err) {
    if (pageData.sideTitle === "新增染色直通奖") {
        post({
            url: "/dwPc/DyeDirectMoney/insertList",
            data: objectOP,
        }).then((res: any) => {
            if (res.code === 200) {
                formRef.value?.resetFields();
                pageData.showAdd8 = false;
                Message.success({
                    content: "新增成功",
                    duration: 5000,
                });
                doRefresh();
            } else {
                Message.error({
                    content: res.message,
                    duration: 5000,
                });
            }
        })
    } else {
        post({
            url: "/dwPc/DyeDirectMoney/updateList",
            data: objectOP,
        }).then((res: any) => {
            if (res.code === 200) {
                formRef.value?.resetFields();
                pageData.showAdd8 = false;
                Message.success({
                    content: "修改成功",
                    duration: 5000,
                });
                doRefresh();
            } else {
                Message.error({
                    content: res.message,
                    duration: 5000,
                });
            }
        })
    }
    //     }
    // })
}

// 下拉框
const focusSel = () => {
    selCxAll({ "processName": "" });
}
const options = ref<any>(pageData.nameList);
const loading = ref(false);
const handleSearch = (value: any) => {
    if (value) {
        const ob = { processName: value, deleteState: 0 }
        loading.value = true;
        selCxAll(ob);
        options.value = pageData.nameList;
        loading.value = false;
    } else {
        options.value = []
    }
};
function selCxAll(val: any) {
    post({
        url: "/pdm/worksectionWorkprocedure/select ",
        data: val
    }).then(({ data, code }: any) => {
        if (code === 200) {
            pageData.nameList = data;
        } else {
            Message.error({
                content: "查询失败！",
                duration: 5000,
            });
        }
    });

}

// 删除事件
const deleteHandler = () => {
    if (gridOption.value.getSelectedRows().length === 0) {
        Message.error('请先勾选')
        return;
    }
    Modal.confirm({
        title: "系统提示",
        content: "确认删除选中的数据?",
        onOk() {
            post({
                url: "/dwPc/DyeDirectMoney/delete",
                data: gridOption.value.getSelectedRows().map((o: any) => { return o.id })
            }).then(({ code, data, message }: any) => {
                if (code === 200) {
                    Message.success({
                        content: "删除成功",
                        duration: 5000,
                    });

                    pagination.page = 1
                    doRefresh();

                } else {
                    Message.error({
                        content: '删除失败',
                        duration: 5000,
                    });
                }

            });
        },
    });
};
// 查询事件
const total = ref(0);
const pagingList1: any = ref(pagingList)
function doRefresh() {
    pageData.pageLoading = true
    dateForm.page = pagination.page
    dateForm.size = pagination.pageSize
    post({
        url: "/dwPc/DyeDirectMoneyUser/getPage",
        data: dateForm,
    })
        .then(({ data, code }: any) => {
            if (code === 200) {

                table.handleSuccess(data.list);
                // gridOption.value.setRowData(data.list)
                pageData.dataListOP = data.list
                total.value = data.total;

            }
        })
        .catch(console.log).finally(() => {
            pageData.pageLoading = false
        })
}
const pagination = usePagination(doRefresh);
const table = useTable();
// 扫描明细数据查询
let visiblecg = ref(false)
let loadingElplus = ref<boolean>(false)
const select = () => {
    visiblecg.value = true
    getList()
}
// 明细渲染数据删除事件
const dels = () => {
    if (gridOption1_2.value.getSelectedRows().length === 0) {
        Message.error('请先勾选')
        return;
    } else {
        let ob = gridOption1_2.value.getSelectedRows().map((item: any) => {
            return item.crockCalorieId
        })
        tableDataList1_2.value = tableDataList1_2.value.filter((item: any) => !ob.includes(item.crockCalorieId));
        companys()
    }
}
// 直通奖员工计算事件
const companys = () => {
    if (tableDataList1_2.value.length !== 0) {
        tableDataList1.value = []
        let oa: any[] = []
        let temp: any = {};
        // oa = tableDataList1.value
        tableDataList1_2.value.forEach((o: any) => {
            let ob: any = ''
            ob = o.money / o.userList.length
            o.userList.forEach((p: any) => {
                // p.money = ob
                // oa.push(p)
                if (p.userCode in temp) {
                    temp[p.userCode].money += ob;
                } else {
                    temp[p.userCode] = p;
                    temp[p.userCode].money = ob;
                    oa.push(temp[p.userCode]);
                }
            })
        })
        tableDataList1.value = [...oa]
        console.log(tableDataList1.value, '姑苏盛产的丝绸盖着我消瘦');

    } else {
        tableDataList1.value = []
    }
}
// 扫描明细保存事件
const print = () => {
    if (gridOption5.value.getSelectedRows().length === 0) {
        Message.error('请先勾选')
        return;
    } else {
        // let oa = ''
        // gridOption1.value.getSelectedRows().map((o: any) => {
        //     return oa = o.id
        // })
        let ob: any[] = []
        ob = tableDataList1_2.value
        gridOption5.value.getSelectedRows().map((o: any) => {
            // o.matchBatchGreyId = oa;
            ob.push(o)
        })
        tableDataList1_2.value = [...ob]
        // console.log(tableDataList1_2.value, '人生得意须尽欢，悲歌曲调唱晚');
        companys()
    }
}
// 扫描明细查询事件
const getList = async () => {
    if (tableDataList1_2.value.length === 0) {
        pageData.notInIdList = []
    } else {
        pageData.notInIdList = tableDataList1_2.value.map((item: any) => {
            return item.crockCalorieId
        })
        // console.log(pageData.notInIdList, '一生中最爱');
    }
    try {
        loadingElplus.value = true
        let { code, data, message } = await post({
            url: '/dwPc/DyeDirectMoneyDetail/getDyeFormulaYield',
            data: {
                page: pagination.page,
                size: pagination.pageSize,
                workteam: objectOP.workteam,
                machineCode: objectOP.machineCode,
                notInIdList: pageData.notInIdList
            },
        })
        if (code && code == 200) {
            pageData.dataList = data.list
            pageData.total = data.total
            loadingElplus.value = false
            return
        }
        pageData.dataList = []
    } catch {
        pageData.dataList = []
    } finally {
        loadingElplus.value = false
    }
}
</script>
<script lang="ts">
export default {
    name: "ListOfDyeingDirectAwardsDemo",
}
</script>
<style scoped lang="less">
:deep(.ag-cell) {
    border-right: 1px solid #dde2eb;
}

:deep(.ag-header-cell) {
    border-right: 1px solid #dde2eb;
}

:deep(.ag-cell-value) {
    user-select: initial;
    -moz-user-select: text;
    -ms-user-select: text;
    -webkit-user-select: text;
}
</style>
